﻿using System;
using System.Collections.Generic;
using System.Linq;
namespace SuperStar.Models
{
    public class OptionModels
    {
        public SuperStarEntities DB { get; set; }
        public String DEBUGTYPE { get; set; }

        public OptionModels()
        {
            DB = new SuperStarEntities();
        }
        public String GetValue(String keySelected)
        {
            var value = from p in DB.Options
                           where p.key == keySelected
                           select p.value;
            return value.ToString();
        }
        public bool GetValueOfIsDemo()
        {
            try {
                return Convert.ToBoolean(GetValue("IsDemo"));
            }catch(Exception ex){
                return false;
            }
            
        }
    }
}
